Source for file SC_SendMail.php
Documentation is available at SC_SendMail.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once(dirname(__FILE__
) .
'/../module/Mail.php');
require_once(dirname(__FILE__
) .
'/../module/Mail/mime.php');
$this->arrRecip =
array();
$this->backend =
MAIL_BACKEND;
//-- PEAR::Mailを使ってメール送信オブジェクト作成
$this->objMail =
& Mail::factory($this->backend,
$this->arrRecip[$key] =
$recipient;
function setTo($to, $to_name =
"") {
function setFrom($from, $from_name =
"") {
function setCc($cc, $cc_name =
"") {
$this->reply_to =
$reply_to;
//-- PEAR::Mailを使ってメール送信オブジェクト作成
$this->objMail =
& Mail::factory("smtp", $arrHost);
//-- PEAR::Mailを使ってメール送信オブジェクト作成
$this->objMail =
& Mail::factory("smtp", $arrHost);
// windowsでは文字化けするので使用しない。
// $_name = mb_convert_encoding($_name,"JIS",CHAR_CODE);
$name_address =
"\"".
$_name .
"\"<" .
$mail_address .
">";
$name_address =
$mail_address;
function setItem($to, $subject, $body, $fromaddress, $from_name, $reply_to=
"", $return_path=
"", $errors_to=
"", $bcc=
"", $cc =
"") {
$this->setBase($to, $subject, $body, $fromaddress, $from_name, $reply_to, $return_path, $errors_to, $bcc, $cc);
function setItemHtml($to, $subject, $body, $fromaddress, $from_name, $reply_to=
"", $return_path=
"", $errors_to=
"", $bcc=
"", $cc =
"") {
$this->setBase($to, $subject, $body, $fromaddress, $from_name, $reply_to, $return_path, $errors_to, $bcc, $cc);
$fromaddress -> 送信元のメールアドレス
$from_name -> 送信元の名前(全角OK)
$return_path -> return-pathアドレス設定(エラーメール返送用)
function setBase($to, $subject, $body, $fromaddress, $from_name, $reply_to=
"", $return_path=
"", $errors_to=
"", $bcc=
"", $cc =
"") {
// 本文設定(iso-2022-jpだと特殊文字が?で送信されるのでJISを使用する)
$this->setFrom($fromaddress, $from_name);
// Errors-Toは、ほとんどのSMTPで無視され、Return-Pathが優先されるためReturn_Pathに設定する。
} else if($return_path !=
"") {
$arrHeader['MIME-Version'] =
'1.0';
$arrHeader['To'] =
$this->to;
$arrHeader['Subject'] =
$this->subject;
$arrHeader['From'] =
$this->from;
if($this->reply_to !=
"") {
$arrHeader['Reply-To'] =
$this->reply_to;
$arrHeader['Cc'] =
$this->cc;
$arrHeader['Bcc'] =
$this->bcc;
$arrHeader['Date'] =
date("D, j M Y H:i:s O");
$arrHeader['Content-Type'] =
"text/plain; charset=\"ISO-2022-JP\"";
$arrHeader['Content-Transfer-Encoding'] =
"7bit";
$arrHeader['Content-Type'] =
"text/html; charset=\"ISO-2022-JP\"";
$arrHeader['Content-Transfer-Encoding'] =
"ISO-2022-JP";
switch ($this->backend) {
if (PEAR::isError($result)) {
if (PEAR::isError($result)) {
* メーラーバックエンドに応じたパラメータを返す.
* @param string $backend Pear::Mail のバックエンド
* @return array メーラーバックエンドに応じたパラメータの配列
$arrParams =
array('sendmail_path' =>
'/usr/bin/sendmail',
Documentation generated on Tue, 28 Apr 2009 18:13:40 +0900 by phpDocumentor 1.4.2